import api from './index'
import axios from 'axios'

let headers = {
    'Content-Type': 'application/json',
    'Authorization': 'jwt ' + localStorage.getItem('token'),
};
export default {
    register(data) {
        return axios.post(api.register(), JSON.stringify(data), {headers: headers})
    },
    login(data) {
        return axios.post(api.login(), JSON.stringify(data), {headers: headers})
    },
    upload(data) {
        return axios.post(api.upload(), JSON.stringify(data), {headers: headers})
    },
    history() {
        return axios.get(api.history(), {headers: headers})
    },
    checkDetail(id) {
        return axios.get(api.checkDetail(), {params: {id: id}},{headers: headers})
    }

}
